/**
 * 
 */
package cn.haona.game.simb.object.bio;

import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.util.HashMap;

import cn.haona.db.RelevanceBean;
import cn.haona.game.simb.comm.util.Util;
import cn.haona.game.simb.object.Persistence;
import cn.haona.game.simb.object.PersistenceImpl;
import cn.haona.game.simb.object.god.MainManager;

/**
 * @author Administrator
 * 
 */
public class User extends Human implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4143334062184604888L;

	/*
	 * (non-Javadoc) 初始化持久化对象
	 * 
	 * @see cn.haona.game.simb.Cell#initPO()
	 */
	public void initPO() {
		if (pO == null) {
			pO = new UserPO();
//			pO.initMe();
		}
		System.out.println("初始化用户");
	}

	/**
	 * 得到UserPO对象
	 * 
	 * @return
	 */
	public UserPO getUserPO() {
		return (UserPO) pO;
	}

	/*
	 * (non-Javadoc) <p>Title: logic</p> <p>Description: 逻辑</p>
	 * 
	 * @see cn.haona.game.simb.CellImpl#logic()
	 */
	public void logic() {
		super.logic();
	}

	public void login() {
		// TODO 清除数据库中洗车状态为关闭的洗车流程
	}

	public void logout() {

	}

	/**
	 * 
	 * <p>
	 * Title: UserPO
	 * </p>
	 * <p>
	 * Description: 持久化对象
	 * </p>
	 * <p>
	 * Company: xunjie
	 * </p>
	 * 
	 * @author shenhao
	 * @date 2010-3-8
	 */
	public class UserPO extends PersistenceHuman implements Serializable {

		/**
		 * 
		 */
		private static final long serialVersionUID = -966232997249976041L;
		// 表名
		final public static String TABLE_NAME = "OPT_USERBASE";
		// 登录名
		final public static String LOGINNAME = "USER_LOGINNAME";
		// 密码
		final public static String PASSWORD = "USER_PASSWORD";
		// 电器技能
		final public static String ELEC = "USER_ELEC";
		// 开锁技能
		final public static String LOCK = "USER_LOCK";
		// 隐秘技能
		final public static String SECRET = "USER_SECRET";
		// 驾驶能力
		final public static String DRIVE = "USER_DRIVE";

		// 昵称
		private String loginName;
		// 密码
		private String password;

		// 电器能力
		private Integer elec;
		// 开锁能力
		private Integer lock;
		// 隐秘能力
		private Integer secret;
		// 驾驶能力
		private Integer drive;

//		public UserPO(Object objParam)
//		{
//			super(objParam);
//		}
		
		/**
		 * 设置基础的反射关联
		 * 
		 * @param reflectRelevance
		 */
		public void setReflectRelevance(
				HashMap<String, RelevanceBean> reflectRelevance) {
			super.setReflectRelevance(reflectRelevance);
			reflectRelevance.put(LOGINNAME, new RelevanceBean("loginName",
					LOGINNAME));
			reflectRelevance.put(PASSWORD, new RelevanceBean("password",
					PASSWORD));
			reflectRelevance.put(ELEC, new RelevanceBean("elec", ELEC));
			reflectRelevance.put(LOCK, new RelevanceBean("lock", LOCK));
			reflectRelevance.put(SECRET, new RelevanceBean("secret", SECRET));
			reflectRelevance.put(DRIVE, new RelevanceBean("drive", DRIVE));
		}

		// public UserPO() {
		// setTableName(TABLE_NAME);
		// }

		public boolean cacheMe() {
			// TODO Auto-generated method stub
			return false;
		}

		public String getLoginName() {
			return loginName;
		}

		public void setLoginName(String loginName) {
			this.loginName = loginName;
		}

		public Integer getElec() {
			return elec;
		}

		public void setElec(Integer elec) {
			this.elec = elec;
		}

		public Integer getLock() {
			return lock;
		}

		public void setLock(Integer lock) {
			this.lock = lock;
		}

		public Integer getSecret() {
			return secret;
		}

		public void setSecret(Integer secret) {
			this.secret = secret;
		}

		public Integer getDrive() {
			return drive;
		}

		public void setDrive(Integer drive) {
			this.drive = drive;
		}

		public String getPassword() {
			return password;
		}

		public void setPassword(String password) {
			this.password = password;
		}
	}

}
